package hhm.utils.client;

import java.util.ArrayList;
import java.util.List;

import hhm.utils.tree.Node;
import hhm.utils.tree.NodeUtil;

public class Treeview {
	// 本地模拟数据测试
	public static void main(String[] args) {
		long start = System.currentTimeMillis();
		List<Node> nodeList = new ArrayList<Node>();
		Node node1 = new Node(1l, "蔬菜", 0l);
		Node node2 = new Node(2l, "水产", 0l);
		Node node3 = new Node(3l, "畜牧", 0l);
		Node node4 = new Node(4l, "瓜类", 1l);
		Node node5 = new Node(5l, "叶类", 1l);
		Node node6 = new Node(6l, "丝瓜", 4l);
		Node node7 = new Node(7l, "黄瓜", 4l);
		Node node8 = new Node(8l, "白菜", 1l);
		Node node9 = new Node(9l, "虾", 2l);
		Node node10 = new Node(10l, "鱼", 2l);
		Node node11 = new Node(11l, "牛", 3l);

		nodeList.add(node1);
		nodeList.add(node2);
		nodeList.add(node3);
		nodeList.add(node4);
		nodeList.add(node5);
		nodeList.add(node6);
		nodeList.add(node7);
		nodeList.add(node8);
		nodeList.add(node9);
		nodeList.add(node10);
		nodeList.add(node11);

		System.out.println(nodeList);
		NodeUtil mt = new NodeUtil();
		
		System.out.println(mt.getChildNodes(nodeList, 1l));
		long end = System.currentTimeMillis();
		System.out.println("用时:" + (end - start) + "ms");
	}
}
